/****** Object:  Stored Procedure [dbo].spChiTietPhieuNhapGetList Script Date: 6/12/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spChiTietPhieuNhapGetList]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spChiTietPhieuNhapGetList]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		14/06/2012	SongTM					Innit created
*******************************************************************************/


CREATE PROCEDURE [dbo].[spChiTietPhieuNhapGetList]

WITH ENCRYPTION
AS

SELECT
	[tbl_ChiTietPhieuNhap].MaCTPN,
	[tbl_ChiTietPhieuNhap].SoPN,
	[tbl_ChiTietPhieuNhap].SoLuong,
	[tbl_ChiTietPhieuNhap].DonGia,
	tbl_LuuKho.*,
	tbl_DonViTinh.*
	
FROM [tbl_ChiTietPhieuNhap] INNER JOIN tbl_LuuKho ON tbl_LuuKho.MaLuuKho=tbl_ChiTietPhieuNhap.MaLuuKho
	INNER JOIN tbl_SanPham ON tbl_SanPham.MaThuoc = tbl_LuuKho.MaThuoc
	INNER JOIN tbl_DonViTinh ON tbl_DonViTinh.MaDonVi = tbl_SanPham.MaDonVi
GO

--GRANT EXECUTE ON [dbo].[spChiTietPhieuNhapGetList] TO [sa]
--GO
